package com.yang.domain;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 订单表
 * @TableName order
 */
@TableName(value ="orders")
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "Order", description = "订单模型")
public class Order implements Serializable {
    /**
     * 订单编号
     */
    @ApiModelProperty(value = "订单编号")
    @TableId
    private String id;

    /**
     * 用户编号
     */
    @ApiModelProperty(value = "用户编号")
    private Integer userId;

    /**
     * 订单总价
     */
    @ApiModelProperty(value = "订单总价")
    private Double totalPrice;

    /**
     * 创建者编号
     */
    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建者编号")
    private Integer createBy;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    /**
     * 更新者编号
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty(value = "更新者编号")
    private Integer updateBy;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty(value = "更新时间")
    private LocalDateTime updateTime;

    /**
     * 
     */
    @ApiModelProperty(value = "逻辑删除列")
    private Integer delFlag;

    @ApiModelProperty(value = "订单内商品")
    @TableField(exist = false)
    private List<Goods> goodsList;

    @ApiModelProperty(value = "司机信息")
    @TableField(exist = false)
    private User driver;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}